package zzl.com.fof;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapred.JobConf;
import org.apache.hadoop.mapreduce.Job;
import zzl.com.mr.MapReducer;
import zzl.com.mr.WordMapper;
import zzl.com.mr.WordReducer;

/**
 * Created by EDZ on 2018/3/27.
 */
public class ForTest {
    public static void main(String[] args)throws Exception {
        System.setProperty("hadoop.home.dir", "E:\\hadoop-2.7.5");
        JobConf conf = new JobConf(ForTest.class);
        conf.set("mapreduce.app-submission.cross-platform", "true");
        conf.set("dfs.permissions", "false");
        /**本地运行**/
        conf.set("mapreduce.output.fileoutputformat.outputdir","E:/ideawork/maven/bigdata/test/fofout/");
        conf.set("mapreduce.input.fileinputformat.inputdir","E:/ideawork/maven/bigdata/test/fof.text");
        conf.setJobName("ForTest");
        Job job = Job.getInstance(conf);
        job.setMapperClass(FofMapper.class);
        job.setReducerClass(FofReducer.class);
        job.setMapOutputKeyClass(Text.class);
        job.setMapOutputValueClass(LongWritable.class);
        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(LongWritable.class);
        job.waitForCompletion(true);
    }
}
